//
//  LoadBolck.swift
//  AliBaiChuan
//
//  Created by 郑东喜 on 2017/2/20.
//  Copyright © 2017年 郑东喜. All rights reserved.
//

import UIKit

class LoadBolck: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.
    }
    
    override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
        
        let page = AlibcTradePageFactory.myCartsPage()
        let service = AlibcTradeSDK.sharedInstance().tradeService()
        
        let showParams : AlibcTradeShowParams = AlibcTradeShowParams()
        showParams.openType = .H5
        showParams.isNeedPush = true
        
        service?.show(showParams.isNeedPush ? self.navigationController! : self,
                      page: page,
                      showParams:showParams,
                      
                      taoKeParams: nil,
                      trackParam: ["track_key":"track_value"], tradeProcessSuccessCallback: { (result) in
                        
                        print("\((#file as NSString).lastPathComponent):(\(#line))\n",result as Any)
        }, tradeProcessFailedCallback: { (error) in
            print("\((#file as NSString).lastPathComponent):(\(#line))\n",error as Any)
        })
        
    }
    
}
